package com.spring;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 阿里面试
 * 
 * @author Administrator
 *
 */
public class Interview {
	public volatile static int s = 0;

	private  static void one() {
		System.out.println(Thread.currentThread() + "" + (++s));
	}

	public  static void main(String[] args) {
		ExecutorService executorService = Executors.newFixedThreadPool(5);
		for (int i = 0; i < 5; i++) {
			Thread thread = new Thread(new Runnable() {

				@Override
				public void run() {
					one();
				}

			});
			executorService.execute(thread);
		}
	}

}
